package com.ruiysoft.entity.order;


import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;

import java.io.Serializable;
import java.util.Date;

/**
 * <p>
 * 关于"现金金额-amount"和"虚拟币virtualCoin"
 * 如果存在混合的虚拟币类型：现金金额+固定虚拟币 + 自由虚拟币的，存在多个支付记录。
 * 固定虚拟币--amount为0，virtualCoin不为0
 * 自由虚拟币--virtualCoin 和 amount都不为0，类似汇率
 * 不支持虚拟币--amount不为0，virtualCoin为0.
 * </p>
 *
 * @author WenJialu
 * @since 2018-10-28
 */
@TableName("order_pay")
public class OrderPay extends Model<OrderPay> {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    @TableField("order_id")
    private Long orderId;

    @TableField("order_no")
    private String orderNo;

    @TableField("order_amount")
    private Long orderAmount;

    @TableField("transaction_no")
    private String transactionNo;
    /**
     * 现金金额
     */
    private Long amount;

    /*
     * 支付策略
     */
    /*@TableField("price_strategy")
    private Integer priceStrategy;*/

    /*
     * 虚拟币
     */
    /*@TableField("virtual_coin_price")
    private Long virtualCoinPrice;*/

    /*
     * 需要支付的虚拟币
     */
    /*@TableField("virtual_coin")
    private Long virtualCoin;*/

    /**
     * 1 微信
     * 2 积分
     */
    @TableField("pay_type")
    private Integer payType;

    /**
     * 1 待支付
            2 用户支付 待平台确认
            3 平台确信 待商铺确认
            4 支付完成
            5 支付失败
     */
    private Integer status;

    @TableField("pay_time")
    private Date payTime;

    @TableField("update_time")
    private Date updateTime;

    private String message;

    public Long getId() {
        return id;
    }

    public OrderPay setId(Long id) {
        this.id = id;
        return this;
    }
    public Long getOrderId() {
        return orderId;
    }

    public OrderPay setOrderId(Long orderId) {
        this.orderId = orderId;
        return this;
    }
    public String getOrderNo() {
        return orderNo;
    }

    public OrderPay setOrderNo(String orderNo) {
        this.orderNo = orderNo;
        return this;
    }
    public Long getOrderAmount() {
        return orderAmount;
    }

    public OrderPay setOrderAmount(Long orderAmount) {
        this.orderAmount = orderAmount;
        return this;
    }

    /*public Integer getPriceStrategy() {
        return priceStrategy;
    }

    public OrderPay setPriceStrategy(Integer priceStrategy) {
        this.priceStrategy = priceStrategy;
        return this;
    }

    public Long getVirtualCoinPrice() {
        return virtualCoinPrice;
    }

    public OrderPay setVirtualCoinPrice(Long virtualCoinPrice) {
        this.virtualCoinPrice = virtualCoinPrice;
        return this;
    }

    public Long getVirtualCoin() {
        return virtualCoin;
    }

    public OrderPay setVirtualCoin(Long virtualCoin) {
        this.virtualCoin = virtualCoin;
        return this;
    }*/


    public String getTransactionNo() {
        return transactionNo;
    }

    public OrderPay setTransactionNo(String transactionNo) {
        this.transactionNo = transactionNo;
        return this;
    }
    public Long getAmount() {
        return amount;
    }

    public OrderPay setAmount(Long amount) {
        this.amount = amount;
        return this;
    }
    public Integer getPayType() {
        return payType;
    }

    public OrderPay setPayType(Integer payType) {
        this.payType = payType;
        return this;
    }
    public Integer getStatus() {
        return status;
    }

    public OrderPay setStatus(Integer status) {
        this.status = status;
        return this;
    }
    public Date getPayTime() {
        return payTime;
    }

    public OrderPay setPayTime(Date payTime) {
        this.payTime = payTime;
        return this;
    }
    public Date getUpdateTime() {
        return updateTime;
    }

    public OrderPay setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
        return this;
    }
    public String getMessage() {
        return message;
    }

    public OrderPay setMessage(String message) {
        this.message = message;
        return this;
    }



    @Override
    protected Serializable pkVal() {
        return this.id;
    }

    @Override
    public String toString() {
        return "OrderPay{" +
        "id=" + id +
        ", orderId=" + orderId +
        ", orderNo=" + orderNo +
        ", orderAmount=" + orderAmount +
        ", transactionNo=" + transactionNo +
        ", amount=" + amount +
        ", payType=" + payType +
        ", status=" + status +
        ", payTime=" + payTime +
        ", updateTime=" + updateTime +
        ", message=" + message +
        "}";
    }
}
